package it.orma.iridehr.entities;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

@Entity
@Table(name = "NEWS_CANDIDATI")
public class News extends EntitaBase implements Serializable{
	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "ID_NEWS")
	private Long idNews;

	@Column(name = "EMAIL")
	private String email;
	
	@OneToOne
	@JoinColumn(name = "ID_OPPORTUNITA")
	@NotFound(action=NotFoundAction.IGNORE)
	private Opportunita opportunita;
	
	@Column(name = "GESTITO", length = 1)
	private String gestito;
	
	@Column(name = "MAIL_INVIATA", length = 1)
	private String mailInviata;
	
	@Column(name = "VISIBILE", length = 1)
	private String visibile;
	
	@Transient
	private boolean hasOpportunita;	
	
	@Transient
	private boolean existing;
	
	@Transient
	private boolean hideEmail;
	
	@Transient
	private Long idCandidato;
	
	public String getEmail() {
		return email;
	}

	public void setEmail(String eMail) {
		this.email = eMail;
	}

	public Long getIdNews() {
		return idNews;
	}

	public void setIdNews(Long idNews) {
		this.idNews = idNews;
	}

	public Opportunita getOpportunita() {
		return opportunita;
	}

	public void setOpportunita(Opportunita opportunita) {
		this.opportunita = opportunita;
	}

	public String getGestito() {
		return gestito;
	}

	public void setGestito(String gestito) {
		this.gestito = gestito;
	}

	public String getMailInviata() {
		return mailInviata;
	}

	public void setMailInviata(String mailInviata) {
		this.mailInviata = mailInviata;
	}

	public boolean isHasOpportunita() {
		return hasOpportunita;
	}

	public void setHasOpportunita(boolean hasOpportunita) {
		this.hasOpportunita = hasOpportunita;
	}

	public boolean isExisting() {
		return existing;
	}

	public void setExisting(boolean existing) {
		this.existing = existing;
	}

	public Long getIdCandidato() {
		return idCandidato;
	}

	public void setIdCandidato(Long idCandidato) {
		this.idCandidato = idCandidato;
	}

	public String getVisibile() {
		return visibile;
	}

	public void setVisibile(String visibile) {
		this.visibile = visibile;
	}

	public boolean isHideEmail() {
		return hideEmail;
	}

	public void setHideEmail(boolean hideEmail) {
		this.hideEmail = hideEmail;
	}

}
